<?php
	$linkStart 		= $this->currentUrl . '/page/' . $this->first;
	$linkPrevious 	= $this->currentUrl . '/page/' . $this->previous;
	$linkNext 		= $this->currentUrl . '/page/' . $this->next;
	$linkEnd 		= $this->currentUrl . '/page/' . $this->last;
	
	$current		= $this->current;
	$pageCount		= $this->pageCount;
	
	$strPage = '';
	foreach ($this->pagesInRange as $key){
		if( $this->current == $key ){
			$strPage .= '<span>' . $key . '</span>';
		}else{
			$linkPage = $this->currentUrl . '/page/' . $key;
			$strPage .= '<a href="' . $linkPage . '" title="Page ' . $key . '">' . $key . '</a>';
		}
	}
	
	$page = 'Trang ' . $this->current . '/' . $this->last;
?>
<div class="pagination">
	<div class="limit">
		Display #
		<select id="limitPage" name="limitPage" class="select" size="1" onchange="appForm.submit();">
			<option value="5" <?php if($this->itemCountPerPage == 5) echo 'selected="selected"';?>>5</option>
			<option value="10" <?php if($this->itemCountPerPage == 10) echo 'selected="selected"';?>>10</option>
			<option value="15" <?php if($this->itemCountPerPage == 15) echo 'selected="selected"';?>>15</option>
			<option value="20" <?php if($this->itemCountPerPage == 20) echo 'selected="selected"';?>>20</option>
			<option value="25" <?php if($this->itemCountPerPage == 25) echo 'selected="selected"';?>>25</option>
			<option value="30" <?php if($this->itemCountPerPage == 30) echo 'selected="selected"';?>>30</option>
			<option value="50" <?php if($this->itemCountPerPage == 50) echo 'selected="selected"';?>>50</option>
			<option value="100" <?php if($this->itemCountPerPage == 100) echo 'selected="selected"';?>>100</option>
		</select>
	</div>
	<?php
		if($current == $this->first)
		{ 
	?>
	<div class="page-right off">
		<div class="start">
			<span>Start</span>
		</div>
	</div>
	<div class="page-right off">
		<div class="prev">
			<span>Prev</span>
		</div>
	</div>
	<?php
		}else{ 
	?>
	<div class="page-right">
		<div class="start">
			<a href="<?php echo $linkStart;?>" title="Start">Start</a>
		</div>
	</div>
	<div class="page-right">
		<div class="prev">
			<a href="<?php echo $linkPrevious;?>" title="Prev">Prev</a>
		</div>
	</div>
	<?php
		} 
	?>
	<div class="page-left">
		<div class="page">
			<?php echo $strPage;?>
		</div>
	</div>
	<?php
		if($current == $pageCount)
		{ 
	?>
	<div class="page-left off">
		<div class="next">
			<span>Next</span>
		</div>
	</div>
	<div class="page-left off">
		<div class="end">
			<span>End</span>
		</div>
	</div>
	<?php
		}else{
	?>
	<div class="page-left">
		<div class="next">
			<a href="<?php echo $linkNext;?>" title="Next">Next</a>
		</div>
	</div>
	<div class="page-left">
		<div class="end">
			<a href="<?php echo $linkEnd;?>" title="End">End</a>
		</div>
	</div>
	<?php 
		}
	?>
	<div class="limit"><?php echo $page . ' - Tổng: <b>' . $this->totalItemCount . '</b>';?></div>
</div>
